<template>
    <div>
        <div class="xuanxiangzhi" v-for="(item, index) in answerLenght">
            <el-input v-model="questionAnswer[index]" class="input" placeholder="">
                <template #prepend>{{ index + 1 }}.</template>
            </el-input>
        </div>
    </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { getqueryBankAPI } from '@/api/api'

const props = defineProps({
    questionId: {
        default: "",
    }
})
//答案
const questionAnswer = ref([])
const answerLenght = ref()
onMounted(() => {
    //查询题目
    if (props.questionId) {
        getqueryBankAPI(props.questionId).then(res => {
            if (res.data.code == 200) {
                answerLenght.value = JSON.parse(res.data.data.questionAnswer)
                console.log(answerLenght.value, 'answerLenght.value ');
            }
        })
    }

})
</script>

<style lang="less" scoped>
.xuanxiangzhi {
    margin-left: 10px;
    display: flex;
    text-align: center;

    .input {
        width: 780px;
        padding: 5px 0;
    }

}
</style>